package com.octo.poker;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.octo.poker.data.Hand;

@Service
public class PokerGame {
	
	@Autowired
	protected PokerComparator pokerComparator;
	
	public String gameResult(Hand yours, Hand his) {
		int res = pokerComparator.compare(yours, his);

		if (res > 0) {
			return "Vous avez gagne";
		}
		if (res < 0) {
			return "Vous avez perdu";
		}
		return "Vous etes egalite";
	}

}
